<template>
  <div id="app">
    <div id="nav">
      <div class="logo">
        <img src="@/assets/icon/logo.png" alt="" />
      </div>
      <router-link to="/">首页</router-link>
      <router-link to="/download">下载</router-link>
      <router-link to="/about">介绍</router-link>
      <router-link to="/test">测试</router-link>
    </div>
    <keep-alive>
      <router-view />
    </keep-alive>
    <player-bar ref="playerBar" v-if="havaResource"></player-bar>
  </div>
</template>

<script>
import playerBar from "@/components/playerBar/playerBar.vue"
export default {
  components: {
    playerBar,
  },
  computed:{
    havaResource(){
      return this.$store.state.musicDetail.url != "";
    }
  }
}
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  height: 52px;
  padding: 10px;
  background: #000;
  @media screen and (max-width: 600px) {
      z-index: 100;
    }

  a {
    font-weight: bold;
    color: #888;
    float: right;
    margin-right: 30px;
    margin-top: 5px;
    font-size: $font-size-m;
    text-decoration: none;
    transition: 0.5s ease-out;
    font-family: YouSheBiaoTiHei-2;

    &.router-link-exact-active {
      color: #42b983;
    }
    &:hover {
      color: #fff;
    }
  }

  .logo {
    position: fixed;
    left: 10px;
    top: 0px;
    @media screen and (max-width: 600px) {
      z-index: -1;
    }
  }
}
</style>
